import fetch from 'common/src/utils/fetch';

/**
 * 同步辅修微专业课程
 */
export function addMinorCourseOpen(calendarId) {
    return fetch({
        url: '/api/arrangementservice/MinorCourseOpen/addMinorCourseOpenByCulture?calendarId='+calendarId,
        method: 'get',
    });
}

/**
 * 获取辅修微专业课程
 * @param {*} data 
 */
export function findMinorCourse(data) {
    return fetch({
        url: '/api/arrangementservice/MinorCourseOpen/findMinorCourse',
        method: 'post',
        headers: { 'Content-Type': 'application/json' },
        data
    })
}

/**
 * 辅修微专业开课
 * @param {data} data
 */
export function openMinorCourse(data) {
    return fetch({
        url: '/api/arrangementservice/MinorCourseOpen/openMinorCourse',
        method: 'post',
        headers: { 'Content-Type': 'application/json' },
        data
    })
}

/**
 * 取消辅修微专业开课
 * @param {*} data
 */
export function deOpenMinorCourse(data) {
    return fetch({
        url: '/api/arrangementservice/MinorCourseOpen/deOpenMinorCourse',
        method: 'post',
        headers: { 'Content-Type': 'application/json' },
        data
    })
}  

/**
 * 删除辅修微专业课程
 * @param {*} data
 */
export function deleteMinorCourse(data) {
    return fetch({
        url: '/api/arrangementservice/MinorCourseOpen/deleteMinorCourse',
        method: 'delete',
        headers: { 'Content-Type': 'application/json' },
        data
    })
}

/**
 * 导出辅修微专业开课
 */
export function minorCourseExport(data) {
    return fetch({
        url: '/api/arrangementservice/publicelective/minorCourseExport',
        method: 'post',
        data:data
    });
}
  
  /**
   * 辅修微专业的异步状态
   * @param {*} key
   */
  export function getReportStatus(key) {
    return fetch({
      url: '/api/arrangementservice/NonPublicCourseOpen/result/' + key,
      method: 'get'
    });
}

/**
 * 查询同步状态
 *
 */
export function getStatus(key) {
    return fetch({
        url: '/api/arrangementservice/MinorCourseOpen/findSyndromeStatus?key='+key,
        method: 'get'
    });
}

/**
 * 查询专业
 * @param {*} id
 */
export function queryProfession(data) {
    return fetch({
        url: '/api/arrangementservice/MinorCourseOpen/findMinorProfessonsById',
        method: 'post',
        data: data
    });
}